Problem with set[Left|Right|Top|Bottom]Margin for QTextBlock in QTextEdit/QPlainTextEdit

Posted by sint on Stack Overflow See other posts from Stack Overflow or by sint
Published on 2010-04-21T21:46:43Z Indexed on 2010/04/28 12:03 UTC
Read the original article Hit count: 245

Filed under:
|

Hi everybody,

how can i set different margins for each QTextBlock in QTextEdit/QPlainTextEdit?

i tried to set it with following code:

class MyWidget(QPlainTextEdit):

    def func(self):
        block = self.firstVisibleBlock()
        while block.isValid():
            block = block.next()
            block.blockFormat().setLeftMargin(<some_value>)

but it's not working

Thanks

© Stack Overflow or respective owner

Related posts about qt

Related posts about pyqt